package org.example.service.Impl;

import org.example.entity.Comment;
import org.example.entity.Post;
import org.example.entity.Response;
import org.example.entity.Users;
import org.example.service.CommentService;
import org.example.service.MainService;
import org.example.service.PostService;
import org.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MainServiceImpl implements MainService {
    @Autowired
    private CommentService commentService;

    @Autowired
    private PostService postService;

    @Autowired
    private UserService userService;


    @Override
    public Response login(Users users) throws Exception {
        return this.userService.login(users);
    }

    @Override
    public Response focus(Integer befocusId, Integer focusId) throws Exception {
        return this.userService.focus(befocusId,focusId);
    }

    @Override
    public Response canclefocus(Integer befocusId, Integer focusId) throws Exception {
        return this.userService.canclefocus(befocusId,focusId);
    }

    @Override
    public Response updateUserInfo(Users user) throws Exception {
        return this.userService.updateUserInfo(user);
    }

    @Override
    public Response getUserInfo(Integer uid) throws Exception {
        return this.userService.getUserInfo(uid);
    }

    @Override
    public Response getAllPosts(Integer page, String classification, Integer posterId) throws Exception {
        return this.postService.getAllPosts(page,classification,posterId);
    }

    @Override
    public Response getPostDetail(Integer postID) throws Exception {
        return this.postService.getPostDetail(postID);
    }

    @Override
    public Response starPost(Integer postID) throws Exception {
        return this.postService.starPost(postID);
    }

    @Override
    public Response updatePost(Post post) throws Exception {
        return this.postService.updatePost(post);
    }

    @Override
    public Response addPost(Post post) throws Exception {
        return this.postService.addPost(post);
    }

    @Override
    public Response addcomemt(Comment comment) throws Exception {
        return this.commentService.addcomemt(comment);
    }

    @Override
    public Response getcomemt(Integer postID, Integer page) throws Exception {
        return this.commentService.getcomemt(postID,page);
    }

    @Override
    public Response starcomemt(Integer comID) throws Exception {
        return this.commentService.starcomemt(comID);
    }
}
